<%@ page contentType="text/html; charset=UTF-8"%>
<%@page import="com.jytc.framework.constants.SessionNameConstants"%>
<%@page import="com.jytc.framework.commons.AdminLoginToken"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>系统菜单</title>
		<SCRIPT language="javascript" type="text/javascript" src="../js/navi.js"></SCRIPT>
		<%@ include file="/framework/jsp/tree.jsp"%>
	</head>
	<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="10" onload="loadTree();">
		<%
		    String treeXML = "<?xml version='1.0' encoding='GB18030'?><tree id='0></tree>";
		    if (session.getAttribute(SessionNameConstants.ADMIN_LOGIN_TOKEN) != null)
		    {
				AdminLoginToken adminLoginToken = (AdminLoginToken) session.getAttribute(SessionNameConstants.ADMIN_LOGIN_TOKEN);
				treeXML = adminLoginToken.getMenuTreeXml();
		    }
		%>
		<DIV id="oMTData" style="height: 100%;padding-top: 3px;padding-left: 3px;border-bottom: 3px solid #07ADFF;">
			<div id="meunTree" style="height: 100%; "></div>
		</DIV>
	</body>
 
	<script language="javascript">
		/* init tree */
		var tree;
		function loadTree(){
			tree = new dhtmlXTreeObject("meunTree","100%","90%",0);
			tree.setImagePath("/framework/plugins/dhtmlxTree/codebase/imgs/csh_yellowbooks/");
			tree.enableTreeLines(true);
			tree.setOnClickHandler(function(id){clickMenu(id);});
			//alert(treeXml);
			tree.loadXMLString('<%=treeXML%>');
		}
		
		/*click Menu*/
		function clickMenu(id)
		{
			if(tree.getUserData(id,"url")!=null){
				top.main.location.href = tree.getUserData(id,"url");
				return;
			}
		}
	</script>
</html>
